+Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (find_line_containing_point): Revise
+ algorithm for scrolling backwards. This one might actually
+ work with one-line-high Text widgets.
+
+ * gtk/gtkmain.c: Removed a misplaced comment, a few
+ formatting cleanups.
+
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (find_line_containing_point): Revise
+ algorithm for scrolling backwards. This one might actually
+ work with one-line-high Text widgets.
+
+ * gtk/gtkmain.c: Removed a misplaced comment, a few
+ formatting cleanups.
+
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (find_line_containing_point): Revise
+ algorithm for scrolling backwards. This one might actually
+ work with one-line-high Text widgets.
+
+ * gtk/gtkmain.c: Removed a misplaced comment, a few
+ formatting cleanups.
+
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (find_line_containing_point): Revise
+ algorithm for scrolling backwards. This one might actually
+ work with one-line-high Text widgets.
+
+ * gtk/gtkmain.c: Removed a misplaced comment, a few
+ formatting cleanups.
+
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (find_line_containing_point): Revise
+ algorithm for scrolling backwards. This one might actually
+ work with one-line-high Text widgets.
+
+ * gtk/gtkmain.c: Removed a misplaced comment, a few
+ formatting cleanups.
+
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (find_line_containing_point): Revise
+ algorithm for scrolling backwards. This one might actually
+ work with one-line-high Text widgets.
+
+ * gtk/gtkmain.c: Removed a misplaced comment, a few
+ formatting cleanups.
+
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (find_line_containing_point): Revise
+ algorithm for scrolling backwards. This one might actually
+ work with one-line-high Text widgets.
+
+ * gtk/gtkmain.c: Removed a misplaced comment, a few
+ formatting cleanups.
+
Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: hm, set_modal doesn't really work with random
if (gtk_initialized)
return;
- /* There is some argument for putting this in a separate
- * function ... but I don't think that it is much
- * of a restriction to require that GTK+ be used
- * single threaded until gtk_init().
- */
-
#if 0
g_set_error_handler (gtk_error);
g_set_warning_handler (gtk_warning);
}
#ifdef ENABLE_NLS
- bindtextdomain("gtk+",GTK_LOCALEDIR);
+ bindtextdomain("gtk+", GTK_LOCALEDIR);
#endif
/* Initialize the default visual and colormap to be
gint height;
text->current_line = NULL;
-
- if (!text->line_start_cache->next)
- {
- /* @@@ Its visible, right? */
- text->current_line = text->line_start_cache;
- return;
- }
-
- while ( ( scroll && (text->first_cut_pixels != 0) &&
- (CACHE_DATA(text->line_start_cache->next).start.index > point) ) ||
- ( (text->first_cut_pixels == 0) &&
- (CACHE_DATA(text->line_start_cache).start.index > point) ) )
+
+ TEXT_SHOW (text);
+
+ /* Scroll backwards until the point is on screen
+ */
+ while (CACHE_DATA(text->line_start_cache).start.index > point)
+ scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache)));
+
+ /* Now additionally try to make sure that the point is fully on screen
+ */
+ if (scroll)
{
- g_assert (text->line_start_cache->next);
- scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache->next)));
+ while (text->first_cut_pixels != 0 &&
+ text->line_start_cache->next &&
+ CACHE_DATA(text->line_start_cache->next).start.index > point)
+ scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache->next)));
}
-
- TEXT_SHOW (text);
+
gdk_window_get_size (text->text_area, NULL, &height);
for (cache = text->line_start_cache; cache; cache = cache->next)